package net.qhzw.geologr5.gis.service.system.controller;


import net.qhzw.geologr5.gis.common.framework.utils.JsonResult;
import net.qhzw.geologr5.gis.service.system.model.GisCartParam;
import net.qhzw.geologr5.gis.service.system.service.GisCartService;
import net.qhzw.geologr5.gis.service.system.vo.gis.ApplyResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/***
 * gis 购物车 前端控制器
 */
@RequestMapping("gis/cart")
@RestController
public class GisCartController {

    @Autowired
    private GisCartService gisCartService;

    /***
     * 添加购物车
     * @return
     */
    @PostMapping
    public JsonResult add(@RequestBody GisCartParam param){
        return gisCartService.add(param);
    }

    /**
     * 查看购物车
     * @return
     */
    @GetMapping
    public JsonResult index(GisCartParam param){
        return gisCartService.index(param);
    }

    /***
     * 删除购物车
     * @param param
     * @return
     */
    @DeleteMapping
    public JsonResult delete(@RequestBody GisCartParam param){
        return gisCartService.delete(param);
    }


    /****
     * 申请资源
     * @param param 购物车id
     * @return
     */
    @PostMapping("reqResources")
    public JsonResult reqResources(@RequestBody GisCartParam param) {
        return gisCartService.reqResources(param);
    }



}
